<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Obtaining the WSDL for an SCA component offering a Service as
   a Web service</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sca.examples.deploy.html">Deploying an SCA component</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="sca.examples.understanding-wsdl.html">Understanding how the WSDL is generated</a></div>
 <div class="up"><a href="sca.examples.html">范例</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="sca.examples.obtaining-wsdl" class="section">
  <h2 class="title">Obtaining the WSDL for an SCA component offering a Service as
   a Web service </h2>
  
  <p class="para"> 
   SCA components that expose a Web service interface (i.e. have
   an @binding.soap annotation) will return their WSDL definition in
   response to an HTTP request with a get parameter of &quot;wsdl&quot;. The usual
   way to obtain this is with &quot;?wsdl&quot; on the end of a URL. The example
   below uses
   <span class="function"><a href="function.file-get-contents.html" class="function">file_get_contents()</a></span> to obtain WSDL from a
   service and writes it to a temporary file before then obtaining a
   proxy for the service in the usual way. You could of course also
   obtain the WSDL in a browser, or by some other means, and save the file
   yourself. 
  </p>
  
  <p class="para">
   <div class="example" id="example-5187">
    <p><strong>Example #1  Generated WSDL </strong></p>
    <div class="example-contents">
<div class="xmlcode"><pre class="xmlcode">&lt;?php
$wsdl = file_get_contents(&#039;http://www.example.com/Services/Example.php?wsdl&#039;);
file_put_contents(&quot;service.wsdl&quot;,$wsdl); //write the wsdl to a file
$service = SCA::getService(&#039;service.wsdl&#039;); 
?&gt;</pre>
</div>
    </div>

   </div>
  </p>
  
  <p class="para">
   NOTE: If the wsdl requires imported xsds, these will need to be
   fetched separately. 
  </p>
  
 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sca.examples.deploy.html">Deploying an SCA component</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="sca.examples.understanding-wsdl.html">Understanding how the WSDL is generated</a></div>
 <div class="up"><a href="sca.examples.html">范例</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
